package com.entity;

import com.comm.RegexHelper;
import com.constant.RegularExpression;

public class StringModel {
	private  final String systemCommandStrat="#";
	
	public StringModel(String expression) {
		Expression=expression;
	}
	
	public String Expression;
	
	public StringType geStringType() {
		StringType stringType = StringType.CreateVariable;
		if (Expression.startsWith(systemCommandStrat)) {
			stringType = StringType.SystemCommand;
		} else if (RegexHelper.isMatch(Expression,RegularExpression.IS_TYPE)) {
			stringType=StringType.CreateType;
		} else if (RegexHelper.isMatch(Expression,RegularExpression.IS_CREATEVARIABLE)) {
			stringType=StringType.CreateVariable;
		} else if (RegexHelper.isMatch(Expression,RegularExpression.IS_FUNCTION)) {
			stringType=StringType.CreateFunction;
		} else if (RegexHelper.isMatch(Expression,RegularExpression.IS_VARIABLE_EXPRESSION)) {
			stringType=StringType.VariableExpression;
		} else {
			stringType=StringType.VariableAssignment;
		}
		return stringType;
	}
}
